<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="/ExamOnline/easyui/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="/ExamOnline/easyui/themes/icon.css">
		<script type="text/javascript" src="/ExamOnline/easyui/jquery.min.js"></script>
		<script type="text/javascript" src="/ExamOnline/easyui/jquery.easyui.min.js"></script>
		<script type="text/javascript" charset="utf-8" src="/ExamOnline/ueditor/ueditor.config.js"></script>
		<script type="text/javascript" charset="utf-8" src="/ExamOnline/ueditor/ueditor.all.min.js"></script>
		<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
		<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
		<script type="text/javascript" charset="utf-8" src="/ExamOnline/ueditor/lang/zh-cn/zh-cn.js"></script>

	</head>

	<body>
		<div class="easyui-panel"  id="addpanel" title="新增试题" style="width:99%;">
			<form id="ff" method="post">
				<table cellpadding="5" width="95%">
					<tr>
						<td width="80" align="center">题目:</td>
						<td>
							<textarea name="qtitle" id="editor" style="width:100%" data-options="required:true"></textarea>
						</td>
					</tr>
					<tr>
						<td align="center">选项A:</td>
						<td><textarea rows="2" cols="100" name="optiona" data-options="required:true"></textarea></td>
					</tr>
					<tr>
						<td align="center">选项B:</td>
						<td><textarea rows="2" cols="100" name="optionb"></textarea></td>
					</tr>
					<tr>
						<td align="center">选项C:</td>
						<td><textarea rows="2" cols="100" name="optionc"></textarea></td>
					</tr>
					<tr>
						<td align="center">选项D:</td>
						<td><textarea rows="2" cols="100" name="optiond"></textarea></td>
					</tr>
					<tr>
						<td align="center">题型:</td>
						<td>
							<label for="sig">单选题</label><input id="sig" type="radio" name="qtype"  value="1" checked="checked" onclick="changeqt(1)">&nbsp;
							<label for="mut">多选题</label><input id="mut" type="radio" name="qtype" value="2"  onclick="changeqt(2)">&nbsp;
					</tr>
					<tr>
						<td align="center">答案:</td>
						<td class="answertd">
							<label for="a">A</label><input id="a"  value="A"  type="radio" name="answer" checked="checked">&nbsp;
							<label for="b">B</label><input id="b"  value="B"  type="radio" name="answer">&nbsp;
							<label for="c">C</label><input id="c"  value="C"  type="radio" name="answer">&nbsp;
							<label for="d">D</label><input id="d"  value="D"  type="radio" name="answer"></td>
					</tr>
					<tr>
						<td align="center">阶段:</td>
						<td>
							<select name="stageid" class="easyui-combobox" panelHeight="auto">
								<option value="1">一阶段</option>
								<option value="2">二阶段</option>
								<option value="3">三阶段</option>
								<option value="4">四阶段</option>
							</select>
						</td>
					</tr>
					<tr>
						<td align="center">关键字:</td>
						<td><input class="easyui-textbox" name="keyword" placeholder="输入当前试题的关键字,使用逗号分割" style="width: 500px;"></td>
					</tr>
					<tr>
						<td align="center">答案解析:</td>
						<td><textarea rows="3" cols="100" name="analysis"></textarea></td>
					</tr>
					<tr>
						<td colspan="2">
							<div style="text-align:center;padding:5px">
								<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">新增</a>
							</div>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<script type="text/javascript">
			$("#addpanel").height($(document).height());
			//实例化编辑器
			var ue = UE.getEditor('editor',{
						 			initialFrameWidth :800,//设置编辑器宽度
						 			initialFrameHeight:150,//设置编辑器高度
						 			scaleEnabled:true
			});

			function changeqt(qt) {
				var tp = "radio";
				if(qt == 2) {
					tp = "checkbox";
				}
				$(".answertd input").each(function(num, ele) {
					$(ele).attr("type", tp);
				})
			}
			
			function submitForm() {
				$.post("/ExamOnline/question/add", $('#ff').serialize(), function(r) {
					$.messager.alert('提示消息', r);
				});
			}
		</script>
	</body>

</html>